<!--
    说明：招聘企业-企业预览pc
 -->
<template>
  <section class="pc-review-page">
    <!-- 公司基本信息 -->
    <div class="company-info">
      <img
        v-imgError
        class="logo-img"
        src="../../../assets/images/logo_demo.png"
        alt="logo-img"
      >
      <div class="right-block">
        <div class="name">Gridex科技</div>
        <div class="area">电子商务</div>
      </div>
      <div class="right-hire">
        <div class="hire-num">120</div>
        <div class="hire-title">在招职位</div>
        <div class="btn"><span class="edit-icon" /> 填写简历</div>
        <div class="click-num">点击量：300</div>
      </div>
      <div class="tag">
        <span
          :class="['item', { current: tagType === 0 }]"
          @click="tagType = 0"
        >企业介绍</span>
        <span
          :class="['item', { current: tagType === 1 }]"
          @click="tagType = 1"
        >在招职位</span>
      </div>
    </div>
    <section v-if="tagType === 0">
      <!-- 热招职位 -->
      <div class="row-item">
        <div class="title">
          热招职位
          <div class="all"><span class="all-icon" />查看全部职位</div>
        </div>
        <el-row :gutter="12">
          <el-col :span="8">
            <div class="job-item">
              <div class="job-name">
                产品实习生 <span class="salary">200-250/天</span>
              </div>
              <div class="other">
                4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />深圳
              </div>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="job-item">
              <div class="job-name">
                运营实习生 <span class="salary">200-250/天</span>
              </div>
              <div class="other">
                4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />深圳
              </div>
            </div>
          </el-col>
          <el-col :span="8">
            <div class="job-item">
              <div class="job-name">
                前端工程师 <span class="salary">200-250/天</span>
              </div>
              <div class="other">
                4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />深圳
              </div>
            </div>
          </el-col>
        </el-row>
      </div>
      <!-- 企业简介 -->
      <div class="row-item">
        <div class="title">Gridex科技简介</div>
        <div class="company-desc">
          Gridex科技是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          前海数据是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          前海数据是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          前海数据是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          前海数据是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          Gridex科技是一家数据服务。
          前海数据是一家数据服数据服前海数据是一家数据服务企业，为合作方提供宏观指标数据、行业指标数据、个性化数据的查询服务。
          前海数据是一家数据服务企业
        </div>
      </div>
      <!-- 企业环境 -->
      <div class="row-item">
        <div class="title">企业环境</div>
        <div id="mySwiper" class="company-environment swiper">
          <div class="swiper-wrapper">
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
            <div class="swiper-slide">
              <img
                src="https://demo-oss.oss-cn-beijing.aliyuncs.com/png/7f8f0f0aeaed481983bd0212fe7d47a8.png"
                alt=""
              >
            </div>
          </div>
          <div class="swiper-button-prev" @click="slidePrev" />
          <div class="swiper-button-next" @click="slideNext" />
        </div>
      </div>
      <!-- 企业地址 -->
      <div class="row-item">
        <div class="title">企业地址</div>
        <div class="company-address">
          <div class="item">
            <span class="position-icon" />广州市荔湾区广州市荔湾区龙溪大道410大参林医药集团
          </div>
          <div class="item">
            <span class="position-icon" />广州市荔湾区广州市广州广州图可数据有限公司
          </div>
          <div class="item">
            <span class="position-icon" />上海市上海街道浦壹电子科技有限公司
          </div>
        </div>
      </div>
    </section>
    <section v-else>
      <!-- 搜索工作栏 -->
      <el-form
        ref="queryForm"
        style="margin: 32px 0 14px"
        :model="queryParams"
        size="small"
        :inline="true"
        label-width="68px"
      >
        <el-form-item prop="status">
          <i class="condition-icon" />
          <el-select
            v-model="queryParams.status"
            placeholder="工作城市"
            clearable
            size="small"
          >
            <el-option
              v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STATUS)"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item prop="companyName">
          <el-select
            v-model="queryParams.status"
            placeholder="招聘对象"
            clearable
            size="small"
          >
            <el-option
              v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STATUS)"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item prop="status">
          <el-select
            v-model="queryParams.status"
            placeholder="学历要求"
            clearable
            size="small"
          >
            <el-option
              v-for="dict in this.getDictDatas(DICT_TYPE.COMPANY_STATUS)"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
          <el-button
            type="primary"
            icon="el-icon-search"
            @click="handleQuery"
          >搜索</el-button>
        </el-form-item>
      </el-form>
      <section class="job-list">
        <div class="item">
          <div class="job-name">产品实习生 <span class="city">深圳</span></div>
          <div class="other">
            4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />200-250/天
          </div>
          <div class="btn">职位详情</div>
        </div>
        <div class="item">
          <div class="job-name">产品实习生 <span class="city">深圳</span></div>
          <div class="other">
            4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />200-250/天
          </div>
          <div class="btn">职位详情</div>
        </div>
        <div class="item">
          <div class="job-name">产品实习生 <span class="city">深圳</span></div>
          <div class="other">
            4天/周 <span class="line" /> 3个月<span class="line" />本科<span class="line" />在校<span class="line" />200-250/天
          </div>
          <div class="btn">职位详情</div>
        </div>
      </section>
      <!-- 分页组件 -->
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="queryParams.pageNo"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </section>
  </section>
</template>

<script>
import Swiper from 'swiper'
import 'swiper/swiper.scss'
export default {
  name: 'PcReview',
  data() {
    return {
      total: 1000,
      tagType: 0,
      swiper: null,
      // 查询参数
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        nickname: null,
        phoneNumber: null,
        companyName: null,
        authorizedStatus: null,
        status: null,
        accountType: '' // 账号类型
      }
    }
  },
  mounted() {
    this.initSwiper()
  },
  methods: {
    getList() {
      console.log('请求页面数据')
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.handleQuery()
    },
    handleQuery() {
      console.log('搜索')
    },
    initSwiper() {
      if (this.swiper === null) {
        this.swiper = new Swiper('#mySwiper', {
          slidesPerView: 3,
          spaceBetween: 25,
          observer: true,
          observeParents: true,
          navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev'
          }
        })
      }
    },
    slidePrev() {
      this.swiper[0].slidePrev()
    },
    slideNext() {
      this.swiper[0].slideNext()
    }
  }
}
</script>
<style lang="scss" scoped>
.pc-review-page {
  position: relative;
  padding: 40px;
  background: #fff;
  .company-info {
    position: relative;
    height: 253px;
    width: 100%;
    border-bottom: 1px solid #d4d6da;
    .logo-img {
      display: block;
      width: 144px;
      height: 144px;
      background: #ffffff;
      border-radius: 8px;
      border: 1px solid #d4d6da;
      float: left;
      margin-right: 30px;
    }
    .right-block {
      position: relative;
      overflow: hidden;
      width: calc(100% - 174px);
      height: 144px;
      display: flex;
      flex-flow: column nowrap;
      justify-content: center;
      align-items: flex-start;
      .name {
        font-size: 50px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #37383d;
        line-height: 70px;
        margin-bottom: 12px;
      }
      .area {
        font-size: 32px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 45px;
      }
    }
    .right-hire {
      position: absolute;
      top: 0;
      right: 0;
      width: 40%;
      height: 100%;
      padding-top: 8px;
      display: flex;
      flex-flow: column nowrap;
      justify-content: flex-start;
      align-items: flex-end;
      .hire-num {
        font-size: 46px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #37383d;
        line-height: 40px;
        margin-bottom: 25px;
        padding-right: 15px;
      }
      .hire-title {
        font-size: 26px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 22px;
        margin-bottom: 38px;
      }
      .btn {
        width: 207px;
        height: 63px;
        line-height: 63px;
        font-size: 26px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #ffffff;
        background: #3d6cb0;
        text-align: center;
        border-radius: 63px;
        cursor: pointer;
        margin-bottom: 12px;
        .edit-icon {
          display: inline-block;
          width: 25px;
          height: 27px;
          background: url("../../../assets/images/edit-icon.png") no-repeat
            center center / cover;
        }
      }
      .click-num {
        font-size: 20px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 22px;
        padding-right: 41px;
      }
    }
    .tag {
      position: absolute;
      left: 0;
      bottom: 23px;
      width: 50%;
      height: 30px;
      padding-left: 10px;
      .item {
        font-size: 20px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 24px;
        margin-right: 45px;
        vertical-align: bottom;
        cursor: pointer;
      }
      .current {
        font-size: 30px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #2f8efe;
        line-height: 30px;
      }
    }
  }
  .row-item {
    position: relative;
    width: 100%;
    padding: 32px 0 45px;
    border-bottom: 1px solid #d4d6da;
    &:last-child {
      border-bottom: 1px solid #fff;
    }
    .title {
      position: relative;
      text-align: left;
      font-size: 28px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #37383d;
      line-height: 40px;
      margin-bottom: 25px;
      .all {
        position: absolute;
        right: 0;
        bottom: 0;
        font-size: 24px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #2f8efe;
        line-height: 33px;
        vertical-align: bottom;
        cursor: pointer;
        .all-icon {
          display: inline-block;
          width: 32px;
          height: 32px;
          background: url("../../../assets/images/check_all.png") no-repeat
            center center / cover;
          vertical-align: bottom;
          margin-right: 15px;
        }
      }
    }
    .job-item {
      position: relative;
      background: #ffffff;
      border-radius: 10px;
      border: 1px solid #d4d6da;
      padding: 25px;
      cursor: pointer;
      .job-name {
        font-size: 28px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #37383d;
        line-height: 40px;
        margin-bottom: 35px;
        .salary {
          font-size: 24px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #9597a0;
          line-height: 40px;
          float: right;
        }
      }
      .other {
        font-size: 22px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 30px;
        .line {
          position: relative;
          display: inline-block;
          width: 1px;
          height: 14px;
          background: #9597a0;
          margin: 0 18px;
        }
      }
    }
    .company-desc {
      font-size: 24px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: #9597a0;
      line-height: 38px;
    }
    .company-environment {
      width: 100%;
      height: 100%;
      .swiper-slide {
        text-align: center;
        font-size: 18px;
        background: #fff;

        /* Center slide text vertically */
        display: -webkit-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-box-align: center;
        -ms-flex-align: center;
        -webkit-align-items: center;
        align-items: center;
      }
      .swiper-slide img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
      .swiper-button-next {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        margin-right: -50px;
        width: 180px;
        height: 180px;
        background: url(../../../assets/images/next.png) no-repeat center center /
          cover;
        cursor: pointer;
        z-index: 1;
      }
      .swiper-button-prev {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        margin-left: -50px;
        width: 180px;
        height: 180px;
        background: url(../../../assets/images/prev.png) no-repeat center center /
          cover;
        cursor: pointer;
        z-index: 1;
      }
    }
    .company-address {
      position: relative;
      .item {
        font-size: 26px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #37383d;
        margin-top: 35px;
        line-height: 37px;
        cursor: pointer;
        &:first-child {
          margin-top: 0;
        }
        .position-icon {
          display: inline-block;
          width: 24px;
          height: 29px;
          margin-right: 15px;
          background: url("../../../assets/images/position.png") no-repeat
            center center / cover;
          vertical-align: middle;
        }
      }
    }
  }
  .condition-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: url("../../../assets/images/condition.png") no-repeat center
      center / cover;
    vertical-align: middle;
    margin-right: 10px;
  }
  .job-list {
    position: relative;
    .item {
      position: relative;
      width: 100%;
      height: 192px;
      margin-bottom: 25px;
      border-radius: 10px;
      padding: 35px 0 0 52px;
      border: 1px solid #d4d6da;
      overflow: hidden;
      &::before {
        content: "";
        display: block;
        width: 20px;
        height: 100%;
        background: #4677b9;
        position: absolute;
        top: 0;
        left: 0;
      }
      .job-name {
        font-size: 36px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: #37383d;
        line-height: 50px;
        margin-bottom: 23px;
        .city {
          font-size: 30px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #9597a0;
          line-height: 42px;
          vertical-align: bottom;
          margin-left: 25px;
        }
      }
      .other {
        font-size: 22px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #9597a0;
        line-height: 30px;
        .line {
          position: relative;
          display: inline-block;
          width: 1px;
          height: 14px;
          background: #9597a0;
          margin: 0 18px;
        }
      }
      .btn {
        position: absolute;
        width: 174px;
        height: 60px;
        line-height: 60px;
        background: #4677b9;
        border-radius: 4px;
        right: 30px;
        top: 50%;
        margin-top: -30px;
        text-align: center;
        font-size: 24px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #ffffff;
        cursor: pointer;
      }
    }
  }
}
</style>
